﻿namespace AC.ExtendedRenderer.Toolkit
{
    using AC.ExtendedRenderer.Toolkit.Utils;
    using ComponentFactory.Krypton.Toolkit;
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
    using System.Windows.Forms.Design;

    [ToolboxBitmap(typeof(Button)), ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.All)]
    public class KryptonColorButtonToolStripMenuItem : ToolStripControlHostFixed
    {
        public KryptonColorButtonToolStripMenuItem() : base(new KryptonColorButton())
        {
            base.AutoSize = false;
        }

        public override Size GetPreferredSize(Size constrainingSize)
        {
            return this.KryptonColorButtonControl.GetPreferredSize(constrainingSize);
        }

        protected override void OnSubscribeControlEvents(Control control)
        {
            base.OnSubscribeControlEvents(control);
        }

        protected override void OnUnsubscribeControlEvents(Control control)
        {
            base.OnUnsubscribeControlEvents(control);
        }

        [RefreshProperties(RefreshProperties.All), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        public KryptonColorButton KryptonColorButtonControl
        {
            get
            {
                return (base.Control as KryptonColorButton);
            }
        }
    }
}

